﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Sunlit.Business.Regions;
using Sunlit.Business.Authorization.Users;
using Sunlit.Business.Common;

namespace Sunlit.Business.Enterprises
{
    /// <summary>
    /// 企业选址
    /// </summary>
    [Table("AbpEnterprises")]
    public class Enterprise:CreationAuditedEntity<long>
    {
        /// <summary>
        /// 标题
        /// </summary>
        [Required]
        [StringLength(256)]
        public string Title { get; set; }
        /// <summary>
        /// 图片地址
        /// </summary>
        [StringLength(512)]
        public string ImageUrl { get; set; }
        /// <summary>
        /// 简单描述
        /// </summary>
        [StringLength(512)]
        public string ShortDesc { get; set; }
        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 浏览次数
        /// </summary>
        public int Hits { get; set; }
        /// <summary>
        /// 所属地区
        /// </summary>
        public int? RegionId { get; set; }
        [ForeignKey(nameof(RegionId))]
        public virtual Region Region { get; set; }
        /// <summary>
        /// 所属类别
        /// </summary>
        public int EnterpriseCateId { get; set; }
        [ForeignKey(nameof(EnterpriseCateId))]
        public virtual EnterpriseCate EnterpriseCate { get; set; }
        /// <summary>
        /// 创建者
        /// </summary>
        [ForeignKey(nameof(CreatorUserId))]
        public virtual User Creator { get; set; }
        /// <summary>
        /// 销售类型
        /// </summary>
        public SaleType SaleType { get; set; }
        /// <summary>
        /// 详细地址
        /// </summary>
        [StringLength(256)]
        public string Address { get; set; }
        /// <summary>
        /// 价格区间
        /// </summary>
        [StringLength(32)]
        public string PriceRange { get; set; }
        /// <summary>
        /// 面积
        /// </summary>
        public decimal Area { get; set; }
        /// <summary>
        /// 结构
        /// </summary>
        [StringLength(128)]
        public string Structure { get; set; }
        /// <summary>
        /// 联系人
        /// </summary>
        [StringLength(32)]
        public string LinkMan { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        [StringLength(32)]
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        [StringLength(64)]
        public string PayMethod { get; set; }
    }
}
